home *** CD-ROM | disk | FTP | other *** search
/ Programming Microsoft Visual Basic .NET / Programming Microsoft Visual Basic .NET (Microsoft Press)(X08-78517)(2002).bin / 24 aspnet applications / aspnetapplications / customsessionform.aspx.vb < prev    next >
Encoding:
Text File  |  2002-01-09  |  1.0 KB  |  32 lines

  1. Public Class CustomSessionForm
  2.     Inherits System.Web.UI.Page
  3.     Protected WithEvents lblCounter As System.Web.UI.WebControls.Label
  4.  
  5. #Region " Web Form Designer Generated Code "
  6.  
  7.     'This call is required by the Web Form Designer.
  8.     <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
  9.  
  10.     End Sub
  11.  
  12.     Private Sub Page_Init(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Init
  13.         'CODEGEN: This method call is required by the Web Form Designer
  14.         'Do not modify it using the code editor.
  15.         InitializeComponent()
  16.     End Sub
  17.  
  18. #End Region
  19.  
  20.     Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
  21.         'Put user code to initialize the page here
  22.         If Session("counter") Is Nothing Then
  23.             Session("counter") = 0
  24.         Else
  25.             Session("counter") = CInt(Session("counter")) + 1
  26.         End If
  27.  
  28.         lblCounter.Text = Session("counter").ToString
  29.     End Sub
  30.  
  31. End Class
  32.